package com.google.coffeeshop;

import com.google.coffeeshop.business.SystemBusiness;

public enum SeatStatus {

	NEW(GeneralConstants.SEAT_NEW_STATUS),
    USABLE(GeneralConstants.SEAT_USABLE_STATUS),
	BUSY(GeneralConstants.SEAT_BUSY_STATUS),
	STOP(GeneralConstants.SEAT_STOP_STATUS),
	TERMINATED(GeneralConstants.SEAT_TERMINATED_STATUS);
	
	private Integer statusId;
	
	private SeatStatus(Integer statusId) {
		this.statusId = statusId;
    }
	
	public Integer getStatusId() {
		return statusId;
	}
	
	public String getStatusValue() {
		return SystemBusiness.getStatusValue(statusId);
	}
	
	static public SeatStatus getSeatStatus(int value) {
		for (SeatStatus seatStatus : SeatStatus.values()) {
			if (seatStatus.getStatusId() == value) {
				return seatStatus;
			}
		}
		return null;
	}
}
